Chris Pollett > Old Classes >
CS174

( Print View )

Student Corner:
  [Grades Sec2]
  [Grades Sec3]

  [Submit Sec2]
  [Submit Sec3]

  [Email List Sec2]
  [Email List Sec3]

  [
Lecture Notes]
  [Discussion Board]

Course Info:
  [Texts & Links]
  [Topics/Outcomes]
  [Outcomes Matrix]
  [Grading]
  [HW Info]
  [Exam Info]
  [Regrades]
  [Honesty]
  [Additional Policies]
  [Announcements]

HW Assignments:
  [Hw1]  [Hw2]  [Hw3]
  [Hw4]  [Hw5]

Practice Exams:
  [Mid1]  [Mid2]  [Final]

                           












HW#3 --- last modified March 02 2019 21:33:15..

Solution set.

Due date: Oct 25

Files to be submitted:
  rest.zip
  bookmark.zip

Purpose: To learn about XML, web services, and databases.

Related Course Outcomes:

rest.html is related to learning outcome (6) [ Develop and deploy web applications that involve components, web services, and databases]. Here we are using the Yahoo REST web services.

The bookmark DTD and XSD and XML files directly address learning outcome (3) [Write XML schemas, XML stylesheets, DTDs, and conforming XML documents] .

The file bookmark.sql is also preliminary to a second pass at learning outcome (6) on a later assignment.

Specification:

For the first part of this assignment I want you to experiment with a small part of the extensive Yahoo Web Services REST API. Details about the particular services we will be interested in can be found at:

Yahoo! Search Web Services

I want you to write a page, rest.html, with a form having a text field and two buttons on it. It should look somewhat like the following:

Search: [             ] [News Search] [Image Search]

When you enter a query and click on [News Search] the onclick event should be trapped, and a REST query should then be made to the Yahoo News Search Service via a proxy on your server. Yahoo! provides the following useful PHP proxy script which you should use. Call it proxy.php and have it live in the same directory as your rest.html file. You should request only 5 results be returned from Yahoo News Search Service and get these results as an XML document. I want you to insert this document dynamically in a div tag on your page without doing a page change or refresh. I want you to use CSS to style the results so that it looks good.

When you enter a query and click on [Image Search] the onclick event should be trapped, and a REST query should then be made to the Yahoo Image Search Service. You should request only 5 results be returned and get these results as an JSON data. I then want you to use this JSON data to display up to five thumbnails dynamically in a div tag on the current page. Each thumbnail should be clickable to the images contained in the result set.

For the second part of the assignment, I want you to come up with a DTD and a XML-schema for storing bookmarks which might be used in a social bookmarking site. These should be written in the files bookmark.dtd and bookmark.xsd . A bookmark should at least include a title, a url, a description, a rank of how intersting it was, and a list of people who suggested it.

I then want you to write two example documents, bookmarkdtd.xml, and bookmarkxsd.xml which should validate against your DTD and your schema.

Finally, for the last part of your assignment I want you to create an SQL script which creates tables which could be used to store your book mark data. Call this script bookmark.sql . Have your script also insert a couple of rows into each of the tables you create.

Put all the bookmark files above into the file bookmark.zip

Point Breakdown

rest.html validates as XHTML1.1 1pt
rest.html News Search button works as described 3pts
rest.html Image Search button works as described 3pts
bookmark.dtd and bookmark.xsd are as described 1pt
Two examples vaildate against both schema and dtd 1pt
bookmark.sql script works on database system listed in its comments (one of Oracle, DB2, Postgres, or MySQL) and is as described 1pt
Total10pts